package com.tky.conference.utlils;

import android.content.Context;
import android.content.Intent;

import com.tky.conference.base.BaseActivity;
import com.tky.conference.base.BaseApplication;

/**
 * Created by yy on 2015/12/4.
 */
public class UIUtils {
    //打开activity
    public static void startActivity(Intent intent) {
        BaseActivity activity = (BaseActivity) BaseActivity
                .getForegroundActivity();
        if (activity != null) {
            activity.startActivity(intent);
        } else {
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            BaseApplication.getContext().startActivity(intent);
        }
    }
}
